<template>
  <div>
        <el-menu
          default-active="kaiguan"
          class="el-menu-vertical-demo"
          @select="handleOpen"
          @close="handleClose"
        >
          <el-submenu index="1">
            <template slot="title">
              <span>配网设备</span>
            </template>
            <el-menu-item index="kaiguan">
              <template slot="title">开关</template>
            </el-menu-item>
            <el-menu-item index="duanluqi">
              <template slot="title">断路器</template>
            </el-menu-item>
            <el-menu-item index="ganta">
              <template slot="title">杆塔</template>
            </el-menu-item>
            <el-menu-item index="kaibisuo">
              <template slot="title">开闭所</template>
            </el-menu-item>
            <el-menu-item index="bianyaqi">
              <template slot="title">变压器</template>
            </el-menu-item>
            <el-menu-item index="yongu">
              <template slot="title">用户</template>
            </el-menu-item>
            <el-menu-item index="zhongduan">
              <template slot="title">终端</template>
            </el-menu-item>
            <el-menu-item index="others">
              <template slot="title">其他设备</template>
            </el-menu-item>
          </el-submenu>
        </el-menu>
  </div>
</template>

<script>
import alldevice from "@/js/Alldevice.js";
export default {
  data() {
    return {
      alldevice
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      this.$emit("select",key)
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  },
  mounted(){
    this.$nextTick(()=>{
      this.handleOpen("kaiguan")
    })
    
  }
};
</script>

<style>
</style>